<template>
  <cTable
    :tableColumn="tableColumn"
    :tableData="STORE.demo1.tableData"
    :tableConfig="tableConfig"
    :formConfig="formConfig"
  >
    <template #buttonA="{ data }">
      <el-button @click="show(data)">buttonA</el-button>
    </template>
    <template #buttonB="{ data }">
      <el-button @click="show(data)">buttonB</el-button>
    </template>
  </cTable>
</template>
<script setup>
  import { onMounted } from 'vue';
  import cTable from 'components/common/cTable/index.vue';
  import { tableColumn, tableConfig, formConfig } from 'components/demo1/demo1a/demo1aa';
  import STORE from 'store';

  const show = data => {
    console.log(data);
  };

  const getData = () => {
    //   const result = await http_xxx();
    const result = {
      data: [
        {
          id: 1,
          name: '杯中的茶',
          united: '太白',
          age: 18,
          gender: '男',
          skill: '云台三落',
          classes: '云台三落',
        },
        {
          id: 2,
          name: '煮酒论逍遥',
          united: '神刀',
          age: 18,
          gender: '男',
          skill: '踏浪斩',
        },
      ],
    };
    STORE.demo1.saveData(result.data);
  };
  onMounted(() => {
    getData();
  });
</script>

<style scoped lang="scss"></style>
